module.exports=function(server){
    const notification=require('./controllers/notification')
    const levels=require('./controllers/levels')
    const user=require('./controllers/user')
    const talent=require('./controllers/talent')
    const talent_audit=require('./controllers/talent_audit')
    const organization=require('./controllers/organization')
    const information=require('./controllers/information')

    server.get('/levels',levels.all)
    server.get('/level2/:id', levels.level2)

    server.get('/user/login',user.login)
    server.get('/user/:user_id',user.get)
    server.get('/user/:user_id/realtime_data',user.realtime_data)
    server.post('/user/register',user.register)
    server.post('/user/modify',user.modify)

    server.get('/talent/:user_id',talent.find)
    server.post('/talent/:user_id',talent.create)
    server.put('/talent/avatar/:talent_id',talent.change_avatar)

    server.get('/talent_audit/:user_id',talent_audit.find)      //查找专家申请信息
    server.post('/talent_audit/upload_avatar/:user_id', talent_audit.upload_avatar) //上传专家头像
    server.post('/talent_audit/register',talent_audit.register) //用户申请注册专家
    server.del('/talent_audit/:user_id',talent_audit.withdraw)  //用户撤回专家注册
    server.get('/talent_audit',talent_audit.findAll)            //审核员获取所有待审核专家信息
    server.get('/talent_audit/count',talent_audit.count)        //审核员获取待审核专家数
    server.patch('/talent_audit/pass/:id/:auditor_id',talent_audit.pass)            //审核通过
    server.patch('/talent_audit/reject/:id/:auditor_id',talent_audit.reject)

    server.get('/notification/:user_id/all', notification.all)  //获取用户所有通知
    server.get('/notification/:user_id/count', notification.count)   //获取用户通知总数
    server.del('/notification/:id', notification.remove)        //移除消息

    server.get('/organization', organization.all)               //获取机构树
    server.get('/organization/:id', organization.one)           //获取机构信息

    server.post('/information/upload', information.upload)   //上传资讯文件
}
